package model;

import java.util.ArrayList;

/**
 * Un Group contient plusieurs Contact
 * @author Mickael
 *
 */
public class Group {

	private ArrayList<Contact> lstContact;
	private String libelle;
	
	/**
	 * Constructeur de Group
	 * @param libelle
	 */
	public Group(String libelle){
		lstContact = new ArrayList<Contact>();
		this.libelle=libelle;
	}

	public String getLibelle() {
		return libelle;
	}

	public void setLibelle(String libelle) {
		this.libelle = libelle;
	}

	public ArrayList<Contact> getLstContact() {
		return lstContact;
	}

	public void setLstContact(ArrayList<Contact> lstContact) {
		this.lstContact = lstContact;
	}
	
	public void addContact(Contact c){
		this.lstContact.add(c);
	}
	
	public void removeContact(Contact c){
		if(this.lstContact.contains(c))
			this.lstContact.remove(c);
	}
	
	public void displayContacts(){
		System.out.println(this.getLibelle()+ " : ");
		for(Contact c : lstContact){
			System.out.println(c);
		}
	}
	
	
	@Override
	public String toString() {
		return libelle ;
	}

	
	
}
